home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Dr. Windows 3
/
dr win3.zip
/
dr win3
/
PROGRAMR
/
JORF21_2.ZIP
/
CONTACT.J
< prev
next >
Wrap
Text File
|
1993-07-05
|
25KB
|
801 lines
Class:Contact
Index:FullName
Index:Company
Index:WorkPhone
Index:LastName
Index:ZipCode
Addr1
Addr2
Addr3
HomePhone
FaxPhone
StartDate
LastUpDate
MailCode
CustCode
Location
Dear
PhoneNote
Comment
Type | Customer, Vendor
Notes | Memo Notes
Sales | Sales to date
Contact:Start()
| JORF Contact Management Data Base
New (Contact:Contact)
| Other source files
Jorf:File("TextEdit.J",Here) | Text Editor
Jorf:File("Filter.J",Here) | Filters
Jorf:File("ConHelp.J",Here) | Help
Jorf:File("ConFlds.J",Here) | Fields
| Initialization . . .
Mem:Ptr->ContactFile = "CONTACT.JCM" | Default Contact File
Mem:Ptr->ContactFName = "CONTACT" | Name to display
Mem:Ptr->ContactFilter = Null | All Records
Mem:Ptr->FilterDescr = "All Records" | All Records
Mem:Ptr->TopLevel = Here | Top Level
Mem:Ptr->PageNo = 0 | Starting Page No
| System Parameters.
Event:Add ("Contact","Key",Here) | Set Contact handler
Contact:KeySearch(Contact,"FullName",False) | Go to top of file
| Contact Manager Main Window
| The purpose of this window is to provide basic information on
| the contact, as well as show a browser of nearby contacts. When
| you add, change or view, you can see additional information for
| this contact. The Additional screens are unlimited.
|
| The Main Window also acts as the Main Menu. All functions are
| menu options from this screen. When the operator hits escape
| (or Alt-X) we are done with the program.
Win:Add ("Josephine's Contact Manager", 2, 2, 22, 78, Here)
Before:"Contact:Page(1)"
Menu:"&File"
Menu:"&Open F4", Action:"Contact:OpenFile()", Hotkey:"F4_Key"
Menu:"&Filter F7", Action:"Contact:Filter()", Hotkey:"F7_Key"
Menu:"F&ield Editor ", Action:"Contact:SetFields()"
Menu:"&Text Editor F9", Action:"Textedit:Start()" HotKey:"F9_Key"
Menu:"&Rebuild ", Action:"Contact:Rebuild()"
Menu:
Menu:"&Dos Shell F5", Action:"Jorf:System(Null,'C')", Hotkey:"F5_Key"
Menu:"Ca&lculator F8", Action:"Calc:Start()", Hotkey:"F8_Key"
Menu:
Menu:"&Set Mailcode ", Action:"Contact:SetMailCode(Contact)"
Menu:"&Clear Mailcode ", Action:"Contact:ClearMailCode(Contact)"
Menu:
Menu:"&About " Action:"Contact:About"
Menu:"Cou&nt Records ", Action:"Contact:Count"
Menu:"&Help F1", Action:"Contact:Help" Hotkey:"F1_Key"
Menu:
Menu:"E&xit Alt-X", Action:"Kbd:Put('Esc_Key')"
Menu:"&Edit"
Menu:"&Add Alt-A", Action:"Contact:Add(Contact)" HotKey:"Alt_A_Key"
Menu:"&Change Alt-C", Action:"Contact:Change(Contact)" HotKey:"Alt_C_Key"
Menu:"&Delete Alt-D", Action:"Contact:Delete(Contact)" HotKey:"Alt_D_Key"
Menu:"&Hundreds ", Action:"Contact:Hundreds(Contact)"
Menu:"&Search",
Menu:"&Name ", Action:"Contact:KeySearch (Contact, 'FullName' ,True)
Menu:"&Company ", Action:"Contact:KeySearch (Contact, 'Company' ,True)
Menu:"&Last Name ", Action:"Contact:KeySearch (Contact, 'LastName' ,True)
Menu:"&Phone ", Action:"Contact:KeySearch (Contact, 'WorkPhone',True)
Menu:"&Zip ", Action:"Contact:KeySearch (Contact, 'ZipCode' ,True)
Menu:"&Reports"
Menu:"&Contact Data", Action:"Contact:PrintData"
Menu:"&List of Contacts", Action:"Contact:List"
Menu:"&Merge Letter", Action:"Contact:MergeLetter"
Menu:"L&abels",
Menu:"&Avery 5162 - Laser Labels", Action:"Contact:Avery5162(Contact,'All')"
Menu:"&Continuous - 1x3½ Inch ", Action:"Contact:ContinLabels(Contact,'All')"
Menu:"&One Label",
Menu:"&Avery 5162 - Laser Labels", Action:"Contact:Avery5162(Contact,'One')"
Menu:"&Continuous - 1x3½ Inch ", Action:"Contact:ContinLabels(Contact,'One')"
InpBefore:"Contact:Lock(Contact)"
Input:"File:" Row:22 Col:1 Wid:8 Field:"Mem:Ptr->ContactFName" Before:"False"
Input:"Index:" Row:22 Col:18 Wid:10 Field:"Mem:Ptr->IndexName" Before:"False"
Input:"Filter:" Row:22 Col:40 Wid:30 Field:"Mem:Ptr->FilterDescr" Before:"False"
Group:"&Browse List", Row:1 Col:41, Len:6, Wid:36
List:""
Field:"Contact"
Next:"Contact:NextRecord(Contact,'Next')"
Prev:"Contact:NextRecord(Contact,'Prev')"
Show:"Contact:Show(Contact)"
Before:"Contact:Write()"
Display:"(Mem:Ptr->Locked==Null)"
Action:"Contact:Change(Contact)"
Group:"C&ontact", Row:1, Col:1, Wid:38, Len:6
Input:"Contact", Wid:30, Field:"Contact->FullName"
After:"Contact:SplitName(Contact)"
Input:"Company", Wid:30, Field:"Contact->Company"
Input:"Address", Wid:30, Field:"Contact->Addr1"
Input:" ", Wid:30, Field:"Contact->Addr2"
Input:" ", Wid:30, Field:"Contact->Addr3"
After:"Contact:ZipCode(Contact)"
Radio:"USA" Row:7 Col:2
Action:"Contact->Location='USA'"
UnAction:"Contact->Location=Null"
Check:"Contact->Location=='USA'"
Radio:"Canada/Mexico" Row:7 Col:11
Action:"Contact->Location='CanMex'"
UnAction:"Contact->Location=Null"
Check:"Contact->Location=='CanMex'"
Radio:"Foreign" Row:7 Col:30
Action:"Contact->Location='Foreign'"
UnAction:"Contact->Location=Null"
Check:"Contact->Location=='Foreign'"
Marker:"Box"
Marker:"Fields"
| Fields will go here
Marker:"EndFields"
If (Kbd:Got='Esc_Key')
Return (Null)
Return (Contact)
Contact:About
Msg:Add ("The JORF Contact Manager", "Ok")
The JORF Contact Manager
Version 1.3, March 20, 1993
Copyright (C) 1993 by Wayland Bruns
All Rights Reserved
The JORF Contact Manager is written as
a demonstration of what you can do with
the JORF Language. The contact manager
is a "flat file" data base with multiple
keys, multiple files, filters, mail-
merge capability, reports and labels.
The source code for this entire system
is less than 1000 lines, and you can
easily change it to suit your own
contact management needs.
Return (Ok)
Contact:Add(*Contact)
New (Contact:NewContact)
Contact:SetFile()
NewContact->FullName="New Record"
Jorf:Write(NewContact)
Contact=NewContact
Win:Dsp
Kbd:Put("Alt_O_Key")
Return(Ok)
Contact:Alt_F5_Key
Win:Msg('Flushing')
Jorf:Flush
Win:Msg()
Return (Ok)
Contact:Alt_Page_Down_Key
If (ConFlds:IsPage(Mem:Ptr->PageNo+1))
Contact:Page(Mem:Ptr->PageNo+1)
Else
Contact:Page(1)
Return (Ok)
Contact:Alt_Page_Up_Key
New (PageNo)
If (Mem:Ptr->PageNo>1)
Contact:Page(1)
Else
Contact:Page(ConFlds:LastPage())
Return (Ok)
Contact:Alt_X_Key
Return (Contact:Exit)
Contact:Avery5162(Contact,Flag)
New (Dest,Count,StartPos,OrigContact)
Dest=Jorf:Printer()
If (Dest)
Event:Add
StartPos=1
Mem:Ptr->InsMode='OverStrike'
Win:Add ("Starting Position")
Type:"Message"
String:"This format prints on the right row of the"
String:"Avery 5162 label. To conserve paper, you"
String:"may enter the label to start with. The top"
String:"label is #1, and the bottom is #7."
String:""
Input:"Label to start ", Wid:5, Field:"StartPos"
String:""
String:"When each sheet is printed, turn it around"
String:"to print on the other side."
Win:Del
Mem:Ptr->InsMode='Insert"
If (Kbd:Got = 'Esc_Key')
Return (Ok)
Contact:SetFile()
OrigContact = Contact
| Report format for Continuous labels, 6 lines per label
|
Rep:Add ("Avery Labels", 9, 5, 49, 45, Here)
Next:"Contact:NextLabel(Contact,Flag,Count)"
Before:"Contact:Avery5162check(Contact,OrigContact,StartPos,Count)"
Item:"" NewRo